package practice;

public class NarcissusFlower {
    public static void main(String[] args) {
        PrintNarcissusFlower();
    }
    public static void PrintNarcissusFlower() {
        for(int i = 100;i <= 999;i++){
            boolean x = false;
            int tmp = 0;
            int j = i;
            while(j != 0){
                tmp += (j % 10) * (j % 10) * (j % 10);
                j /= 10;
            }
            if(tmp == i){
                x = true;
            }
            if(x){
                System.out.print(i + " ");
            }
        }
    }
}
